home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gcc / gcc260utilsdoc.lha / gnu / man / man1 / bison.1 < prev    next >
Encoding:
Text File  |  1994-07-28  |  6.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. BISON(1)                 USER COMMANDS                   BISON(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      bison - GNU Project parser generator (yacc replacement)
  10.  
  11. SYNOPSIS
  12.      bison [ -b _f_i_l_e-_p_r_e_f_i_x ] [ --file-prefix=_f_i_l_e-_p_r_e_f_i_x ] [  -d
  13.      ]  [  --defines  ]  [  -l  ] [ --no-lines ] [ -o _o_u_t_f_i_l_e ] [
  14.      --output-file=_o_u_t_f_i_l_e ] [ -p _p_r_e_f_i_x ] [ --name-prefix=_p_r_e_f_i_x
  15.      ] [ -t ] [ --debug ] [ -v ] [ --verbose ] [ -V ] [ --version
  16.      ] [ -y ] [ --yacc ] [ -h ] [ --help ] [ --fixed-output-files
  17.      ] file
  18.  
  19. DESCRIPTION
  20.      _B_i_s_o_n is a parser generator in the  style  of  _y_a_c_c(1).   It
  21.      should  be upwardly compatible with input files designed for
  22.      _y_a_c_c.
  23.  
  24.      Input files should follow the _y_a_c_c convention of  ending  in
  25.      .y.   Unlike  _y_a_c_c,  the  generated  files do not have fixed
  26.      names, but instead use the prefix of the  input  file.   For
  27.      instance,  a  grammar  description  file named parse.y would
  28.      produce the generated parser in a  file  named  parse.tab.c,
  29.      instead of _y_a_c_c's y.tab.c.
  30.  
  31.      This description of the options that can be given  to  _b_i_s_o_n
  32.      is  adapted  from  the  node Invocation in the bison.texinfo
  33.      manual, which should be taken as authoritative.
  34.  
  35.      _B_i_s_o_n supports both traditional  single-letter  options  and
  36.      mnemonic long option names.  Long option names are indicated
  37.      with -- instead of -.  Abbreviations for  option  names  are
  38.      allowed  as  long  as  they  are unique.  When a long option
  39.      takes an argument, like --file-prefix,  connect  the  option
  40.      name and the argument with =.
  41.  
  42.   OPTIONS
  43.      -b _f_i_l_e-_p_r_e_f_i_x
  44.      --file-prefix=_f_i_l_e-_p_r_e_f_i_x
  45.           Specify a prefix to  use  for  all  _b_i_s_o_n  output  file
  46.           names.   The names are chosen as if the input file were
  47.           named _f_i_l_e-_p_r_e_f_i_x.c.
  48.  
  49.      -d
  50.      --defines
  51.           Write an extra output file containing macro definitions
  52.           for the token type names defined in the grammar and the
  53.           semantic value type YYSTYPE, as well as  a  few  extern
  54.           variable declarations.
  55.  
  56.           If the parser output file is  named  _n_a_m_e.c  then  this
  57.           file is named _n_a_m_e.h.
  58.  
  59.           This output file is essential if you wish  to  put  the
  60.  
  61.  
  62.  
  63. Sun Release 4.1        Last change: local                       1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. BISON(1)                 USER COMMANDS                   BISON(1)
  71.  
  72.  
  73.  
  74.           definition  of yylex in a separate source file, because
  75.           yylex needs to be able to refer to token type codes and
  76.           the variable yylval.
  77.  
  78.      -l
  79.      --no-lines
  80.           Don't put any #line preprocessor commands in the parser
  81.           file.  Ordinarily _b_i_s_o_n puts them in the parser file so
  82.           that the C compiler and debuggers will associate errors
  83.           with  your  source file, the grammar file.  This option
  84.           causes them to associate errors with the  parser  file,
  85.           treating  it  an  independent  source  file  in its own
  86.           right.
  87.  
  88.      -o _o_u_t_f_i_l_e
  89.      --output-file=_o_u_t_f_i_l_e
  90.           Specify the name _o_u_t_f_i_l_e for the parser file.
  91.  
  92.           The other output files' names are constructed from _o_u_t_-
  93.           _f_i_l_e as described under the -v and -d switches.
  94.  
  95.      -p _p_r_e_f_i_x
  96.      --name-prefix=_p_r_e_f_i_x
  97.           Rename the external symbols used in the parser so  that
  98.           they start with _p_r_e_f_i_x instead of yy.  The precise list
  99.           of symbols renamed is yyparse, yylex, yyerror,  yylval,
  100.           yychar, and yydebug.
  101.  
  102.           For example, if you use -p c, the names become  cparse,
  103.           clex, and so on.
  104.  
  105.      -t
  106.      --debug
  107.           Output a definition  of  the  macro  YYDEBUG  into  the
  108.           parser  file, so that the debugging facilities are com-
  109.           piled.
  110.  
  111.      -v
  112.      --verbose
  113.           Write an extra output file containing verbose  descrip-
  114.           tions  of  the  parser states and what is done for each
  115.           type of look-ahead token in that state.
  116.  
  117.           This file also describes all the conflicts, both  those
  118.           resolved  by  operator  precedence  and  the unresolved
  119.           ones.
  120.  
  121.           The file's name is made by removing .tab.c or  .c  from
  122.           the   parser  output  file  name,  and  adding  .output
  123.           instead.
  124.  
  125.           Therefore, if the input file is foo.y, then the  parser
  126.  
  127.  
  128.  
  129. Sun Release 4.1        Last change: local                       2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. BISON(1)                 USER COMMANDS                   BISON(1)
  137.  
  138.  
  139.  
  140.           file is called foo.tab.c by default.  As a consequence,
  141.           the verbose output file is called foo.output.
  142.  
  143.      -V
  144.      --version
  145.           Print the version number of _b_i_s_o_n and exit.
  146.  
  147.      -h
  148.           --help Print a summary of  the  options  to  _b_i_s_o_n  and
  149.           exit.
  150.  
  151.      -y
  152.      --yacc
  153.      --fixed-output-files
  154.           Equivalent to -o y.tab.c; the  parser  output  file  is
  155.           called  y.tab.c,  and  the  other  outputs  are  called
  156.           y.output and y.tab.h.  The purpose of this switch is to
  157.           imitate _y_a_c_c's output file name conventions.  Thus, the
  158.           following shell script can substitute for _y_a_c_c:
  159.  
  160.           bison -y $*
  161.  
  162.  
  163.      The long-named options can be introduced with `+' as well as
  164.      `--',  for compatibility with previous releases.  Eventually
  165.      support for `+' will be removed, because it is  incompatible
  166.      with the POSIX.2 standard.
  167.  
  168. FILES
  169.      /gnu/lib/bison.simple    simple parser
  170.      /gnu/lib/bison.hairy     complicated parser
  171.  
  172. SEE ALSO
  173.      _y_a_c_c(1)
  174.      The  _B_i_s_o_n  _R_e_f_e_r_e_n_c_e   _M_a_n_u_a_l,   included   as   the   file
  175.      bison.texinfo in the _b_i_s_o_n source distribution.
  176.  
  177. DIAGNOSTICS
  178.      Self explanatory.
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sun Release 4.1        Last change: local                       3
  196.  
  197.  
  198.  
  199.